Add Book to My BookshelfPurchase This Book Online

Chapter 1 - Router Basics

Cisco TCP/IP Routing Professional Reference
Chris Lewis
  Copyright © 1999 The McGraw-Hill Companies, Inc.

Getting to Know Your Router
This section explains connecting a terminal to a router, understanding the Cisco user interface, and executing basic Cisco commands.
Connecting a Terminal to a Cisco Router
The discussion here uses connection to a Cisco 2500-series router as an example. Throughout this section, it is assumed that the router to which you are connecting has already received a basic configuration. A later section will cover configuring a router from scratch.
Figure 1-6 shows the connections that we need to make at the rear of a 2501. Each router will come with a console connection kit, which comprises a black RJ-45 cable and an array of connectors. To connect a Wyse or other standard ASCII terminal as the console, do the following:
  1. Connect the RJ-45 cable to the console port on the back of the router.
  2. Connect the 25-pin attachment labeled "terminal" to the other end of the RJ-45 cable.
  3. Connect a male-to-male gender changer to this 25-pin connector.
  4. Connect this 25-pin attachment to the Wyse port.
Figure 1-6: Router console port to ASCII terminal connections
A gender changer is needed because many ASCII terminal providers supply only female connectors on their terminals.
If you want to connect your router to a PC and run a terminal emulator of some kind, life is easier. Most PCs come with 9-pin serial port connectors, so just connect the 9-pin serial connector to the RJ-45 cable and link the router console port to the PC serial port. As long as you set your terminal emulation program to 9600 bps, with 8 data bits, no parity, and 1 stop bit, you should be okay.
The Cisco User Interface
A large part of this text will be devoted to entering configuration, reporting, or other commands, and viewing the router's responses. To do this efficiently in practice, it will help you to know how the Cisco user interface works. Think of this as similar to learning DOSKEY in the PC world or the vi editor in the Unix world. It's important to know at the beginning that you do not have to type in the entire command for the router to know what to do for you. As long as you type enough to identify a unique command, the router will accept it. Here's an example:
Hostname#wri t
This is the abbreviation for the command write terminal; the string wri t is enough information for the router to interpret the command correctly, and, as we shall see later, this command will cause the router to display its configuration to the screen.
Assuming you have connected a terminal to the console port of a previously configured router, you will be presented with a password or router prompt. After entering an appropriate password, if necessary, the display will look something like this:
Hostname>
At this stage, we can start to enter commands. In the Cisco user interface, there are two levels of access: user and privileged. The first level of access that allows you to view router status is known as user EXEC mode.
The privileged mode is known as privileged EXEC mode. This mode is needed to view router configuration, change configuration, and run debugging commands. Privileged EXEC mode often is referred to as Enable mode because, in order to get into privileged EXEC mode, you have to enter the enable command followed by an appropriate password. This is achieved as follows:
Press the Enter key
password:Supply the Enable password, then press Enter
Hostname#
The visual evidence that you now have Enable privilege is that the command prompt has now changed to a # character alone.
Before we proceed, you also need to be aware that the router can be in one of two modes. The first is what I will term view mode. With this mode, you can enter the show and debug commands. This allows you to view the status of interfaces, protocols, and other items related to the router. It is the mode that the router will be in after you first log on. The second is configuration mode. This allows you to alter the configuration running in the router at that time. This is important to realize, because as soon as you press the Enter key after entering a configuration command, that command takes immediate effect even before you leave configuration mode. You can get into configuration mode only after gaining Enable privilege. This is achieved as follows:
Press Enter
Enter configuration commands, one per line. End with Ctrl/Z.
Hostname(config)#
Note that the line telling you to end with Ctrl-Z is echoed back by the computer. The command to get into configuration mode in this case tells the router that it is to be configured from the terminal. The router also can be told to get its configuration from a network server; this will be covered later. You will notice that the prompt changes to remind you that you are in configuration mode.
The following is an example of how to enter configuration commands for the Ethernet 0 interface:
Press the Enter key
Hostname(config-int)#
To move back one level, type in the following:
Press the Enter key
Hostname(config)#
If you wish to exit configuration mode from any level, simultaneously hold down the Ctrl and press the Z key:
Press the Enter key
Hostname#
To exit Enable mode, type in the following:
Press the Enter key
Hostname>
You now have the basics for navigating the user interface.
Shortcuts.The following lists the more useful of the available keystrokes for the Cisco IOS. If <Ctrl-x> appears, it means you should hold down the Ctrl while pressing the character x key.
Arrow Keys.     The arrow keys are useful only with an ANSI/VT100-emulating terminal. The up and down keys display the command history; for example, pressing the up arrow will display the previous command. By default, 10 commands are kept in the history. If you want to change that, go into configuration mode and type in terminal history xx, where xx is the number of commands to remember. The down arrow key will go forward in the command history.
If you are not using an ANSI/VT100 terminal or emulation, the command history can still be accessed by using the <Ctrl-N> and <Ctrl-P> key combinations, for Next and Previous command in the command history.
Backspace or DEL.     Either of these keys deletes the character before the cursor.
Tab or Enter.     Each of these keys executes the command entered.
The ? Key.     Possibly the most useful key in the user interface, the "?" key, can be entered at any time to find out what can be entered next. This is best illustrated with an example:
Hostname>show ip route ?
Press the Enter key
bgp
Border Gateway Protocol
Connected
Connected networks
egp
Exterior Gateways protocol
eigrp
Enhanced Interior Gateway Routing Protocol
igrp
Interior Gateway Routing Protocol
ISO is-is
ospf
Open Shortest Path First
rip
Routing Information Protocol
static
Static routes
summary
summary of all routes
supernets-only
show supernet entries only
Hostname>show ip route
After the question mark is entered, the router informs you of the options available to complete the command, and re-enters the command typed in so far, so that all you need to do is select the appropriate option. As soon as you see a <cr> option in the available command listing, you know that you can press the Enter key and the router will execute the command.
A point to note here is that if the list of options extends past one screen, the last line of the display will show More. Pressing the keyboard space bar will show the next page of information, and pressing the Enter key will show the next single line of information.
The following key combinations illustrate useful commands:
  <Ctrl-A>
Move cursor to beginning of line.
  <Ctrl-B>
Move cursor back one character.
  <Ctrl-D>
Delete the character the cursor is on.
  <Ctrl-H>
Same as backspace, i.e., delete the character before the cursor.
  <Ctrl-K>
Delete characters to end of line. The characters are held in a buffer and can be recalled for later insertion in a command line.
  <Ctrl-U>
Delete to end of line; again, the characters go to a buffer.
  <Ctrl-V>
Used to insert control characters in the command line. It tells the user interface to treat the next character literally, rather than as an editor command.
  <Ctrl-W>
Delete the previous word.
  <Ctrl-Y>
Paste the character from the buffer (same as the yank command in Unix).
  Esc <
Show the first line from the history buffer.
  Esc >
Show the last line from the history buffer.
  Esc b
Move cursor back one word.
  Esc d
Delete the word in front of the cursor.
  Esc f
Move the cursor forward one word.
  Esc Del
Delete the word before the cursor.
Many administrators with either a PC or UNIX background ask about a full-screen editor within the IOS for altering configuration. This is unlikely ever to be available. A full-screen editor within the IOS raises questions of when command syntax is checked, at what time the changed configuration takes effect, and so forth. Once you are familiar with the user interface, it does seem efficient and simple to use. In Chapter 3 we'll look at how a full screen text editor can be used to edit an ASCII file, which can then be loaded via a TFTP server on to a router. The router configuration files are stored as ASCII. This is particularly useful if you have multiple routers to configure, each needing a similar configuration.

 


 
Books24x7.com, Inc © 2000 –  Feedback